import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)
// 配置路由
const routes = [
    {
        path: '/',
        name: 'Home',
        component: Home
    },
    {
        path: '/workspace',
        name: 'WorkSpace',
        component: () => import('../views/WorkSpace.vue'),
        // 子路径
        children: [
            {
                path: '/stu',
                name: 'StuList',
                component: () => import('../views/StuList')
            }
        ]
    }

]

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router
